 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

京东云function接口
function相关接口

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKFunction/FunctionExecutor.h>

@implementation FunctionClient

@synthesize userAgent = _userAgent;
@synthesize serviceName = _serviceName;
@synthesize version = _version;

-(void) addCustomerHeaderWithKey:(NSString*) key
                           value:(NSString*) value{
    if(![self customHeader])
    {
        self.customHeader = [[NSMutableDictionary alloc] init];
    }
    if(key && value)
    {
        [[self customHeader] setValue:value forKey:key];
    }
   
}

-(id)initWithGlobalConfig{
    if(![GlobalConfig credential])
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@"GlobalConfig credential not config" userInfo:nil];
        @throw e;
    }
    self.credential = [GlobalConfig credential];
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"function.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 function  v1";
    _serviceName = @"function";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
         sdkEnvironment:(SDKEnvironment*)sdkEnvironment
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    
    if(!sdkEnvironment)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" sdkEnvironment can not null" userInfo:nil];
        @throw e;
    }else{
        self.sdkEnvironment = sdkEnvironment;
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 function  v1";
    _serviceName = @"function";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"function.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 function  v1";
    _serviceName = @"function";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)init{
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 function  v1";
    _serviceName = @"function";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}


/**
getVersion sync request
@param getVersionRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `getVersionResponse` the request response data model
*/
-(NSDictionary*) getVersionSyncWithRequest:(FunctionGetVersionRequest*) getVersionRequest
{
FunctionGetVersionExecutor* excutor = [[FunctionGetVersionExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:getVersionRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionGetVersionResponse* response = [[FunctionGetVersionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"getVersionResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)getVersionAsyncWithRequest:(FunctionGetVersionRequest*) getVersionRequest
                       completionHandler:(void(^)(int statusCode,FunctionGetVersionResponse* _Nullable getVersionResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionGetVersionExecutor* excutor = [[FunctionGetVersionExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:getVersionRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionGetVersionResponse* response = [[FunctionGetVersionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
createAlias sync request
@param createAliasRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `createAliasResponse` the request response data model
*/
-(NSDictionary*) createAliasSyncWithRequest:(FunctionCreateAliasRequest*) createAliasRequest
{
FunctionCreateAliasExecutor* excutor = [[FunctionCreateAliasExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:createAliasRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionCreateAliasResponse* response = [[FunctionCreateAliasResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"createAliasResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)createAliasAsyncWithRequest:(FunctionCreateAliasRequest*) createAliasRequest
                       completionHandler:(void(^)(int statusCode,FunctionCreateAliasResponse* _Nullable createAliasResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionCreateAliasExecutor* excutor = [[FunctionCreateAliasExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:createAliasRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionCreateAliasResponse* response = [[FunctionCreateAliasResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
createFunction sync request
@param createFunctionRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `createFunctionResponse` the request response data model
*/
-(NSDictionary*) createFunctionSyncWithRequest:(FunctionCreateFunctionRequest*) createFunctionRequest
{
FunctionCreateFunctionExecutor* excutor = [[FunctionCreateFunctionExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:createFunctionRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionCreateFunctionResponse* response = [[FunctionCreateFunctionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"createFunctionResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)createFunctionAsyncWithRequest:(FunctionCreateFunctionRequest*) createFunctionRequest
                       completionHandler:(void(^)(int statusCode,FunctionCreateFunctionResponse* _Nullable createFunctionResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionCreateFunctionExecutor* excutor = [[FunctionCreateFunctionExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:createFunctionRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionCreateFunctionResponse* response = [[FunctionCreateFunctionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
deleteAlias sync request
@param deleteAliasRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `deleteAliasResponse` the request response data model
*/
-(NSDictionary*) deleteAliasSyncWithRequest:(FunctionDeleteAliasRequest*) deleteAliasRequest
{
FunctionDeleteAliasExecutor* excutor = [[FunctionDeleteAliasExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:deleteAliasRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionDeleteAliasResponse* response = [[FunctionDeleteAliasResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"deleteAliasResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)deleteAliasAsyncWithRequest:(FunctionDeleteAliasRequest*) deleteAliasRequest
                       completionHandler:(void(^)(int statusCode,FunctionDeleteAliasResponse* _Nullable deleteAliasResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionDeleteAliasExecutor* excutor = [[FunctionDeleteAliasExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:deleteAliasRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionDeleteAliasResponse* response = [[FunctionDeleteAliasResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
createVersion sync request
@param createVersionRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `createVersionResponse` the request response data model
*/
-(NSDictionary*) createVersionSyncWithRequest:(FunctionCreateVersionRequest*) createVersionRequest
{
FunctionCreateVersionExecutor* excutor = [[FunctionCreateVersionExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:createVersionRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionCreateVersionResponse* response = [[FunctionCreateVersionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"createVersionResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)createVersionAsyncWithRequest:(FunctionCreateVersionRequest*) createVersionRequest
                       completionHandler:(void(^)(int statusCode,FunctionCreateVersionResponse* _Nullable createVersionResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionCreateVersionExecutor* excutor = [[FunctionCreateVersionExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:createVersionRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionCreateVersionResponse* response = [[FunctionCreateVersionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
getFunction sync request
@param getFunctionRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `getFunctionResponse` the request response data model
*/
-(NSDictionary*) getFunctionSyncWithRequest:(FunctionGetFunctionRequest*) getFunctionRequest
{
FunctionGetFunctionExecutor* excutor = [[FunctionGetFunctionExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:getFunctionRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionGetFunctionResponse* response = [[FunctionGetFunctionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"getFunctionResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)getFunctionAsyncWithRequest:(FunctionGetFunctionRequest*) getFunctionRequest
                       completionHandler:(void(^)(int statusCode,FunctionGetFunctionResponse* _Nullable getFunctionResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionGetFunctionExecutor* excutor = [[FunctionGetFunctionExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:getFunctionRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionGetFunctionResponse* response = [[FunctionGetFunctionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
listVersion sync request
@param listVersionRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `listVersionResponse` the request response data model
*/
-(NSDictionary*) listVersionSyncWithRequest:(FunctionListVersionRequest*) listVersionRequest
{
FunctionListVersionExecutor* excutor = [[FunctionListVersionExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:listVersionRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionListVersionResponse* response = [[FunctionListVersionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"listVersionResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)listVersionAsyncWithRequest:(FunctionListVersionRequest*) listVersionRequest
                       completionHandler:(void(^)(int statusCode,FunctionListVersionResponse* _Nullable listVersionResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionListVersionExecutor* excutor = [[FunctionListVersionExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:listVersionRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionListVersionResponse* response = [[FunctionListVersionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
invoke sync request
@param invokeRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `invokeResponse` the request response data model
*/
-(NSDictionary*) invokeSyncWithRequest:(FunctionInvokeRequest*) invokeRequest
{
FunctionInvokeExecutor* excutor = [[FunctionInvokeExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:invokeRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionInvokeResponse* response = [[FunctionInvokeResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"invokeResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)invokeAsyncWithRequest:(FunctionInvokeRequest*) invokeRequest
                       completionHandler:(void(^)(int statusCode,FunctionInvokeResponse* _Nullable invokeResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionInvokeExecutor* excutor = [[FunctionInvokeExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:invokeRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionInvokeResponse* response = [[FunctionInvokeResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
updateAlias sync request
@param updateAliasRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `updateAliasResponse` the request response data model
*/
-(NSDictionary*) updateAliasSyncWithRequest:(FunctionUpdateAliasRequest*) updateAliasRequest
{
FunctionUpdateAliasExecutor* excutor = [[FunctionUpdateAliasExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:updateAliasRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionUpdateAliasResponse* response = [[FunctionUpdateAliasResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"updateAliasResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)updateAliasAsyncWithRequest:(FunctionUpdateAliasRequest*) updateAliasRequest
                       completionHandler:(void(^)(int statusCode,FunctionUpdateAliasResponse* _Nullable updateAliasResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionUpdateAliasExecutor* excutor = [[FunctionUpdateAliasExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:updateAliasRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionUpdateAliasResponse* response = [[FunctionUpdateAliasResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
asyncInvoke sync request
@param asyncInvokeRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `asyncInvokeResponse` the request response data model
*/
-(NSDictionary*) asyncInvokeSyncWithRequest:(FunctionAsyncInvokeRequest*) asyncInvokeRequest
{
FunctionAsyncInvokeExecutor* excutor = [[FunctionAsyncInvokeExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:asyncInvokeRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionAsyncInvokeResponse* response = [[FunctionAsyncInvokeResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"asyncInvokeResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)asyncInvokeAsyncWithRequest:(FunctionAsyncInvokeRequest*) asyncInvokeRequest
                       completionHandler:(void(^)(int statusCode,FunctionAsyncInvokeResponse* _Nullable asyncInvokeResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionAsyncInvokeExecutor* excutor = [[FunctionAsyncInvokeExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:asyncInvokeRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionAsyncInvokeResponse* response = [[FunctionAsyncInvokeResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
getTrigger sync request
@param getTriggerRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `getTriggerResponse` the request response data model
*/
-(NSDictionary*) getTriggerSyncWithRequest:(FunctionGetTriggerRequest*) getTriggerRequest
{
FunctionGetTriggerExecutor* excutor = [[FunctionGetTriggerExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:getTriggerRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionGetTriggerResponse* response = [[FunctionGetTriggerResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"getTriggerResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)getTriggerAsyncWithRequest:(FunctionGetTriggerRequest*) getTriggerRequest
                       completionHandler:(void(^)(int statusCode,FunctionGetTriggerResponse* _Nullable getTriggerResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionGetTriggerExecutor* excutor = [[FunctionGetTriggerExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:getTriggerRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionGetTriggerResponse* response = [[FunctionGetTriggerResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
deleteVersion sync request
@param deleteVersionRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `deleteVersionResponse` the request response data model
*/
-(NSDictionary*) deleteVersionSyncWithRequest:(FunctionDeleteVersionRequest*) deleteVersionRequest
{
FunctionDeleteVersionExecutor* excutor = [[FunctionDeleteVersionExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:deleteVersionRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionDeleteVersionResponse* response = [[FunctionDeleteVersionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"deleteVersionResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)deleteVersionAsyncWithRequest:(FunctionDeleteVersionRequest*) deleteVersionRequest
                       completionHandler:(void(^)(int statusCode,FunctionDeleteVersionResponse* _Nullable deleteVersionResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionDeleteVersionExecutor* excutor = [[FunctionDeleteVersionExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:deleteVersionRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionDeleteVersionResponse* response = [[FunctionDeleteVersionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
deleteFunction sync request
@param deleteFunctionRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `deleteFunctionResponse` the request response data model
*/
-(NSDictionary*) deleteFunctionSyncWithRequest:(FunctionDeleteFunctionRequest*) deleteFunctionRequest
{
FunctionDeleteFunctionExecutor* excutor = [[FunctionDeleteFunctionExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:deleteFunctionRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionDeleteFunctionResponse* response = [[FunctionDeleteFunctionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"deleteFunctionResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)deleteFunctionAsyncWithRequest:(FunctionDeleteFunctionRequest*) deleteFunctionRequest
                       completionHandler:(void(^)(int statusCode,FunctionDeleteFunctionResponse* _Nullable deleteFunctionResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionDeleteFunctionExecutor* excutor = [[FunctionDeleteFunctionExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:deleteFunctionRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionDeleteFunctionResponse* response = [[FunctionDeleteFunctionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
listFunction sync request
@param listFunctionRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `listFunctionResponse` the request response data model
*/
-(NSDictionary*) listFunctionSyncWithRequest:(FunctionListFunctionRequest*) listFunctionRequest
{
FunctionListFunctionExecutor* excutor = [[FunctionListFunctionExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:listFunctionRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionListFunctionResponse* response = [[FunctionListFunctionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"listFunctionResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)listFunctionAsyncWithRequest:(FunctionListFunctionRequest*) listFunctionRequest
                       completionHandler:(void(^)(int statusCode,FunctionListFunctionResponse* _Nullable listFunctionResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionListFunctionExecutor* excutor = [[FunctionListFunctionExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:listFunctionRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionListFunctionResponse* response = [[FunctionListFunctionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
listAlias sync request
@param listAliasRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `listAliasResponse` the request response data model
*/
-(NSDictionary*) listAliasSyncWithRequest:(FunctionListAliasRequest*) listAliasRequest
{
FunctionListAliasExecutor* excutor = [[FunctionListAliasExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:listAliasRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionListAliasResponse* response = [[FunctionListAliasResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"listAliasResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)listAliasAsyncWithRequest:(FunctionListAliasRequest*) listAliasRequest
                       completionHandler:(void(^)(int statusCode,FunctionListAliasResponse* _Nullable listAliasResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionListAliasExecutor* excutor = [[FunctionListAliasExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:listAliasRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionListAliasResponse* response = [[FunctionListAliasResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
getAlias sync request
@param getAliasRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `getAliasResponse` the request response data model
*/
-(NSDictionary*) getAliasSyncWithRequest:(FunctionGetAliasRequest*) getAliasRequest
{
FunctionGetAliasExecutor* excutor = [[FunctionGetAliasExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:getAliasRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionGetAliasResponse* response = [[FunctionGetAliasResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"getAliasResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)getAliasAsyncWithRequest:(FunctionGetAliasRequest*) getAliasRequest
                       completionHandler:(void(^)(int statusCode,FunctionGetAliasResponse* _Nullable getAliasResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionGetAliasExecutor* excutor = [[FunctionGetAliasExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:getAliasRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionGetAliasResponse* response = [[FunctionGetAliasResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
updateFunction sync request
@param updateFunctionRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `updateFunctionResponse` the request response data model
*/
-(NSDictionary*) updateFunctionSyncWithRequest:(FunctionUpdateFunctionRequest*) updateFunctionRequest
{
FunctionUpdateFunctionExecutor* excutor = [[FunctionUpdateFunctionExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:updateFunctionRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionUpdateFunctionResponse* response = [[FunctionUpdateFunctionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"updateFunctionResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)updateFunctionAsyncWithRequest:(FunctionUpdateFunctionRequest*) updateFunctionRequest
                       completionHandler:(void(^)(int statusCode,FunctionUpdateFunctionResponse* _Nullable updateFunctionResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
FunctionUpdateFunctionExecutor* excutor = [[FunctionUpdateFunctionExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:updateFunctionRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    FunctionUpdateFunctionResponse* response = [[FunctionUpdateFunctionResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}


 /**
 function common sync request
 @param  jdcloudDataRequest request param
 @return key `statusCode` http request status code type is int
             `dataResult` the http request response data  type is NSData
             `requestError` the request error type is NSError
 */
 -(NSDictionary*) functionCommonSyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                                   url:(NSString*) url
                                                method:(NSString*) method{
    CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    NSDictionary* responseResult = [excutor executeDataSync:jdcloudDataRequest];
    return responseResult;
}

-(void)functionCommonAsyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                         url:(NSString*) url
                                      method:(NSString*) method
                           completionHandler:(void(^)(int statusCode, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
     CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    
    [excutor executeDataAsync:jdcloudDataRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        completionHandler(statusCode,responseData,error);
    }];
} 

@end
